add 2 microseconds to Date() js

91

add 2 microseconds to Date() js -

// get the current date & time (as milliseconds since Epoch)
const currentTimeAsMs = Date.now();

// Add 2 seconds
const adjustedTimeAsMs = currentTimeAsMs + 2;

// create a new Date object, using the adjusted time
const adjustedDateObj = new Date(adjustedTimeAsMs);

Comments

Submit
0 Comments